package com.ruoyi.app.controller;

import com.ruoyi.app.domain.OperEquip;
import com.ruoyi.app.domain.OperStaff;
import com.ruoyi.app.service.IOperStaffService;
import com.ruoyi.app.service.IOperticketService;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;


@RestController
@RequestMapping("/app/staff/")
public class ApiOperStaffController extends BaseController {
    @Autowired
    private IOperticketService iOperticketService;
    @Autowired
    private IOperStaffService iOperStaffService;
    @Anonymous
    @GetMapping("/getOperstaff")
    @ResponseBody
    public AjaxResult getOperStaff(HttpServletRequest request) {

        String id = getMemberId(request);
        OperStaff operStaff = iOperStaffService.getOperStaffById(Long.parseLong(id));

        OperStaff operStaff1 = new OperStaff();
        operStaff1.setStaffGroupId(operStaff.getStaffGroupId());
        List<OperStaff> operStaffs = iOperticketService.selectOperStaffList(operStaff1);

        return AjaxResult.success("成功",operStaffs);
    }
}
